package com.chey.service.impl;

import com.chey.dao.AirlDao;
import com.chey.pojo.airl.MSG4;
import com.chey.pojo.dfdl.ARPT;
import com.chey.service.AirlService;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.UUID;

@Service
public class AirlServiceImpl implements AirlService {
    @Resource
    private AirlDao airlDao;

    @Override
    public Integer insert(MSG4 msg) {
        String airl_uuid = UUID.randomUUID().toString().replace("-", "").toLowerCase();

        List<ARPT> arpts = msg.getDflt().getARPT();
        for (ARPT arpt : arpts) {

            airlDao.addArpt(airl_uuid,arpt);
        }
        airlDao.add(msg.getMeta(),msg.getDflt(),airl_uuid);


        return null;
    }
}
